public class types {
    public static void main(String[] args) {
        int a=1;
        int b= (int) 1.0;
        float c= (float) 1.0;
        long d=1;
        double q=1;
        float w=1;
        double x=1.0f;
        int[] m={1,3,2};
        test(m);
        quickSort(m,0,m.length-1);
        test2(m);
        for (int item: m
        ) {
            System.out.println(item);
        }
    }
    public static void test(int[] a){
        //不能进行赋值
        for (int item: a
             ) {
            item=2;
        }
        for (int item: a
        ) {
            System.out.print(item);
        }
    }
    public static void quickSort(int[] arr,int low,int high){
        int i,j,temp,t;
        if(low>high){
            return;
        }
        i=low;
        j=high;
        //temp就是基准位
        temp = arr[low];

        while (i<j) {
            //先看右边，依次往左递减
            while (temp<=arr[j]&&i<j) {
                j--;
            }
            //再看左边，依次往右递增
            while (temp>=arr[i]&&i<j) {
                i++;
            }
            //如果满足条件则交换
            if (i<j) {
                t = arr[j];
                arr[j] = arr[i];
                arr[i] = t;
            }

        }
        //最后将基准为与i和j相等位置的数字交换
        arr[low] = arr[i];
        arr[i] = temp;
        //递归调用左半数组
        quickSort(arr, low, j-1);
        //递归调用右半数组
        quickSort(arr, j+1, high);
    }
    public static void test2(int[] arr){
        arr[0]=6;
        arr[1]=4;
        arr[2]=5;
    }
}
